/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gui.servidor;

import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 *
 * @author Anderson
 */
public class ServidorMain {

    final static String HOST_URL = "//localhost:6000/redehoteis";
    final static int port = 6000;

    public ServidorMain() throws RemoteException, AlreadyBoundException, MalformedURLException, IOException {

        LocateRegistry.createRegistry(port);
        IServidor servidor = new Servidor();
        Naming.rebind(HOST_URL, servidor);

    }

    public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException, IOException {

        new ServidorMain();

    }
}
